﻿
Namespace LightSwitchApplication

    Public Class AppointmentDetail

        Private Sub Appointment_Loaded(succeeded As Boolean)
            ' Write your code here.
            Me.SetDisplayNameFromEntity(Me.Appointment)
        End Sub

        Private Sub Appointment_Changed()
            ' Write your code here.
            Me.SetDisplayNameFromEntity(Me.Appointment)
        End Sub

        Private Sub AppointmentDetail_Saved()
            ' Write your code here.
            Me.SetDisplayNameFromEntity(Me.Appointment)
        End Sub

       

        Private Sub ShowMap1_Execute()
            ' Write your code here.
            Me.Application.ShowMapScreen(Me.Appointment.Location)

        End Sub

        Private Sub ShowMap_Execute()
            ' Write your code here.
            Me.Application.ShowMapScreen(Me.Appointment.Location)
        End Sub

        Private Sub CancelAppointment_Execute()
            ' Write your code here.
            If ShowMessageBox("Are you sure you want to cancel this appointment? An email update will be sent.", "Cancel Appointment", MessageBoxOption.YesNo) = Windows.MessageBoxResult.Yes Then
                Me.Appointment.Delete()
                Me.Save()
            End If
        End Sub
    End Class

End Namespace